from flask import Flask

app = Flask(__name__)

# 1. 登记路由：route('/')
@app.route('/',methods=['GET','POST']) # /根路径，首页，相对路径
# 2. 视图函数，返回值为页面的显示信息，文本格式、html、json等
def hello_world():
    return '<h1>Hello World!</h1>'

@app.route('/index',methods=['GET','POST'])
def this_is_headpages():
    return '<h1>这是首页</h1>'


if __name__ == '__main__':
    app.run()

